// components/tabs/tabs.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        list: {
            type: Array,
            value: {
                title: {
                    type: String,
                    value: ""
                },
                text: {
                    type: String,
                    value: ""
                }
            }
        },
        activeColor: {
            type: String,
            value: "#222"
        },
        txtColor: {
            type: String,
            value: "#ddd"
        },
        fontSize: {
            type: String,
            value: "34rpx"
        },
        tabsGap: {
            type: String,
            value: "60rpx"
        },
        line: {
            type: String,
            value: "/assets/tab_line1.png"
        },
        isImgLine: {
            type: Boolean,
            value: false
        },
        activeIndex: {
            type: [String, Number],
            value: 0
        },
    },

    /**
     * 组件的初始数据
     */
    data: {
        
    },
  
    /**
     * 组件的方法列表
     */
    methods: {
        onClick(e) {
            let index = e.currentTarget.dataset.index;
            this.setData({
                activeIndex: index
            })
            this.triggerEvent('change', index);
        }
    }
})